@import "~pc/styles/lib_var.less";
@import "~pc/styles/lib_mixins.less";

.widgetHeaderDev {
  background: var(--lowestBg);
}

.widgetHeader.dragging {
  cursor: grabbing;

  .dragHandle {
    cursor: grabbing;
  }

  .widgetName {
    .name {
     cursor: grabbing;
    }
  }
}

.widgetHeader {
  font-size: 12px;
  display: flex;
  align-items: center;
  height: 34px;
  padding: 0 8px;
  border-radius: 8px 8px 0 0;
  cursor: grab;
  svg {
    vertical-align: -0.125em;
  }

  .widgetName {
    flex: 1;
    display: flex;
    align-items: center;
    margin-right: 4px;
    .ellipsis();
    .name {
      margin-right: 4px;
      display: inline-block;
      cursor: pointer;
      .ellipsis();
    }

    .error {
      border-color: var(--errorColor) !important;
    }

    .tag {
      padding: 0 4px;
      border-radius: 4px;
      text-align: center;
      font-size: 12px;
      line-height: 18px;
    }
    .tagPrimary {
      background: var(--rainbowIndigo1);
      color: var(--rainbowIndigo4);
    }
    .tagSuccess {
      background: var(--teal_100);
      color: var(--teal_700);
    }
  }

  .dragHandle {
    opacity: 1 !important;
    cursor: grab;
    display: flex;
    align-items: center;
    margin-right: 4px;
    margin-left: 0px !important;
  }

  .operateButton {
    opacity: 0;
    display: flex;
    margin-left: 8px;
  }
}

.widgetContainer {
  border: 1px solid var(--lineColor);
  border-radius: 8px;
  width: 100%;
  height: 100%;
  background: var(--defaultBg);
  overflow: hidden;

  &:hover {
    .widgetHeader {
      .dragHandle {
        opacity: 1;
      }

      .operateButton {
        opacity: 1;
      }
    }
  }
}

.widgetWrapper {
  height: 100%;
}

.ExpandWidget() {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--expandWidget);
  background: var(--deepMaskColor);
  border: none;
  transition: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.widgetWrapperExpand {
  .ExpandWidget();
  .widgetContainer {
    position: relative;
    width: 84%;
    height: 82vh;
    .widgetExpandOperateArea {
      position: absolute;
      top: -68px;
      right: 0;
      display: flex;
      align-items: center;
      padding: 16px 0;
  
      .closeButton {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: var(--shadowColor);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
  
        &:hover {
          opacity: 0.8;
        }
  
        &:active {
          opacity: 0.6;
        }
  
        svg {
          fill: white;
        }
      }
    }
  }
}

.widgetWrapperFullscreen {
  .ExpandWidget();
  .widgetContainer {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }
}

.widgetWrapperMobile {
  border-width: 0;
}

.widgetWrapperExpandMobile {
  .widgetContainer {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }
}

.widgetBody {
  position: relative;
  height: calc(100% - 34px);
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mask {
  color: var(--errorColor);
  font-size: 13px;
  display: flex;
  flex-flow: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  cursor: pointer;
  padding-bottom: 10px;

  img {
    transform: translateY(-8px);
    max-width: 160px;
    width: 100%;
  }

  span {
    border-bottom: 1px solid;
    line-height: 1.4;
  }
}

.npOpacity {
  opacity: 1 !important;
}

.rotateIcon {
  transform: rotate(90deg);
}

.widgetHeader.widgetIsExpandHeader {
  padding: 16px;
  height: 50px;
  border-bottom: 1px solid var(--borderCommonDefault);
  cursor: default;
}

.widgetIsExpandBody {
  height: calc(100% - 50px);
}

.iframeMasking {
  display: block;
  position: absolute;
  width: 100%;
  height: 100%;
  background: transparent;
}

.iframeLoadingWarp {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  width: 100%;
  height: 100%;
}

.widgetExpandHeaderMobile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 48px;
  height: 48px;
  box-shadow: inset 0px -1px 0px var(--lineColor);
  .closeIcon {
    position: absolute;
    left: 16px;
  }
  h2 {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
  }
}
